package com.rq.adapter;

import android.view.View;

import com.rq.rvlibrary.BaseAdapter;
import com.rq.rvlibrary.NestingViewHolder;
import com.rq.rvlibrary.EasyViewHolder;
import com.rq.rvlibrary.RecyclerUtil;

import java.util.List;

public class DRVH extends NestingViewHolder {
    public DRVH(View itemView) {
        super(itemView);
    }

    @Override
    public int inflateLayoutId() {
        return R.layout.item_parent;
    }

    @Override
    protected void fillChildData(EasyViewHolder holder, int position, Object childBean, int pPostion) {
        super.fillChildData(holder, position, childBean, pPostion);
//        DebugData item = (DebugData) childBean;
//        holder.setItemText(R.id.text_time, item.time);
//        holder.setItemText(R.id.text_ml, item.num);

        String item = (String) childBean;
        holder.setItemText(R.id.text_time, item + "X");
        holder.setItemText(R.id.text_ml, item + "Y");
    }

    @Override
    protected List getChildData(Object parentBean, int position) {
//        return (List) parentBean;
        return ((DoubleAct.DebugData2) parentBean).childData;
    }

    @Override
    protected RecyclerUtil getChildRecyclerUtil(BaseAdapter adapter) {
        return new RecyclerUtil(adapter).horizontal();
    }

    @Override
    protected int getChildLayoutId() {
        return R.layout.item_child;
    }

    @Override
    protected int getChildRecyclerId() {
        return R.id.recycler_inner;
    }
}
